package implementation.DB.readOnlyRecords;

import java.util.ArrayList;

import java.util.Collections;
import java.util.List;


import implementation.server.IReadOnlyUser;


public class CReadOnlyUser implements IReadOnlyUser {
	
	
	private int _userId;
	private String _userName;
	private String _password;
	private List<Integer> _followers;
	private List<Integer> _followees;

	public CReadOnlyUser(){
		this._followers= new ArrayList<Integer>();
		this._followees= new ArrayList<Integer>();
	}
	
	public CReadOnlyUser(int userId, String userName, String password){
		this._userId= userId;
		this._userName= userName;
		this._password= password;
		this._followers= new ArrayList<Integer>();
		this._followees= new ArrayList<Integer>();	}
	
	public CReadOnlyUser(int userId, String userName, String password,
							List<Integer> _followers ,  List<Integer> _followees){
		this._userId= userId;
		this._userName= userName;
		this._password= password;		
		this._followers= _followers;
		this._followees= _followees;
	}
	
	public String get_userName(){
		return this._userName;
	}
	
	public int get_userId(){
		return this._userId;
	}
	
	public String get_password(){
		return this._password;
	}
	
	
	public void set_userId(int _userId) {
		this._userId = _userId;
	}


	public void set_userName(String _userName) {
		this._userName = _userName;
	}



	public void set_password(String _password) {
		this._password = _password;
	}

	
	public ArrayList<Integer> getFollowees(){
		
		ArrayList<Integer> tAnswer= new ArrayList<Integer>();
		int tTo = this._followees.size();
		for(int index=0; index < tTo; index++){
				tAnswer.add( (Integer) this._followees.get(index));
		}
		return tAnswer;	
	}
		
	

	@Override
	public ArrayList<Integer> getFollowers() {
		ArrayList<Integer> tAnswer= new ArrayList<Integer>();
		int tTo = this._followers.size();
		for(int index=0; index < tTo; index++)
				tAnswer.add( (Integer) this._followers.get(index));

		return tAnswer;	
	}
	

}
